﻿<!-- #include file="../ding.asp" -->
<!-- #include file="../mymin.asp" -->
<%
Call Head2()
w "<title>群聊管理</title></head><body><div class='main400'>"& systemMsgRoot

IF KEY<>0 then Call error("权限不足！")
Dim rs,pagesize,count,i,page,sql,a,tp,id
a=getData("a")
tp=getData("type")
id=getN("id",0)
if a="" then
	Set rs=Server.CreateObject("ADODB.Recordset")
	sql="select id,ip,pltime,pl from 74hu_pl where smsid=0 order by id desc"
	rs.open sql,myconn,1,1
	if not rs.eof then
		PageSize=10
		Count=rs.recordcount
		page=getN("page",1)
		if page<1 then page=1
		pagecount=(count+pagesize-1)\pagesize
		rs.move(pagesize*(page-1))
		
		For i=1 To PageSize
			If rs.eof Then Exit For
			plid=rs("id")
			plip=rs("ip")
			plsj=fordate2(rs("pltime"))
			plnr=nowml(rs("pl"))
			if IsNumeric(plip) then
				plip ="会员ID：<a href=""../bbs/detail.asp?sid="&sid&"&amp;id="&plip&""">"&plip&"</a>"
			Else
				plip ="网友IP："&plip
			end if
			w ""&i+(page-1)*PageSize&"、"&plip&"<br/>时间："&plsj&"<br/>内容："&plnr&"<br/>"&_
					"<a href='talk.asp?sid="&sid&"&amp;id="&plid&"&amp;a=delone'>[删除这条评论]</a><br/>"
			rs.moveNext
		Next
		w showPage("talk.asp", "", page, pageCount)&"管理:<a href=""talk.asp?sid="&sid&"&amp;a=del&amp;type=1"">删除全部</a> "&_
			"<a href=""talk.asp?sid="&sid&"&amp;a=del&amp;type=2"">3天前</a> <a href=""talk.asp?sid="&sid&"&amp;a=del&amp;type=3"">1周前</a>"&_
			" <a href=""talk.asp?sid="&sid&"&amp;a=del&amp;type=4"">1个月前</a> <a href=""talk.asp?sid="&sid&"&amp;a=del&amp;type=5"">半年前</a>"&_
			" <a href=""talk.asp?sid="&sid&"&amp;a=del&amp;type=6"">1年前</a>"
		
	else
		w "暂时没有群聊记录!"
	end if
	rs.close
	Set rs=Nothing
	w "<br/><br/>群聊功能:设计中心-添加栏目-调用栏目-网站群聊"
Elseif a="del" then
	Select Case tp
	Case 1 tp="全部"
	Case 2 tp="3天前"
	Case 3 tp="1周前"
	Case 4 tp="1个月前"
	Case 5 tp="半年前"
	Case 6 tp="1年前"
	Case Else tp=""
	End Select
	w "确定要删除"&tp&"记录?<br/><a href=""talk.asp?sid="&sid&"&amp;type="&tp&"&amp;a=delete"">是,确定删除</a><br/>"&_
		"<a href=""talk.asp?sid="&sid&""">返回管理</a>"
elseif a="delete" then
	Select Case tp
	Case 1 tp=""
	Case 2 tp="and (pltime<#"&dateadd("d", -3, time_now)&"#)"
	Case 3 tp="and (pltime<#"&dateadd("d", -7, time_now)&"#)"
	Case 4 tp="and (pltime<#"&dateadd("d", -30, time_now)&"#)"
	Case 5 tp="and (pltime<#"&dateadd("d", -182, time_now)&"#)"
	Case 6 tp="and (pltime<#"&dateadd("d", -365, time_now)&"#)"
	Case Else tp=""
	End Select
	myconn.Execute("delete from 74hu_pl where smsid=0 "&tp)
	w "删除成功!<a href=""talk.asp?sid="&sid&""">返回管理</a>"
Else
	myconn.Execute("delete from 74hu_pl where smsid=0 and id="&id)
	w "删除成功!<a href=""talk.asp?sid="&sid&""">返回管理</a>"
end if
Call Last2%>